package cn.achao.csr.mybatis.req;

import cn.achao.csr.base.req.BaseCursorReq;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * 游标翻页请求
 * @Author: achao
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MPBaseCursorPageReq extends BaseCursorReq {

    @Min(0)
    @Max(100)
    private Integer pageSize = 10;

    private String cursor;

    public Page plusPage() {
        return new Page(1, this.pageSize, false);
    }
}
